package com.marvels.approve.task.tasklet;

import com.marvels.approve.process.service.IProcessService;
import com.marvels.common.utils.MarvelsLogUtil;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.step.tasklet.Tasklet;
import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author 11271
 * @date 2024/9/28 15:58
 * @Description:
 */
public class TimingBaoFuDirectPaymentStatementsTasklet implements Tasklet {
    @Autowired
    private IProcessService processService;

    @Override
    public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {
        try{
            MarvelsLogUtil.getInstance().info(">>>>>>定时查询时间段内未匹配的转账流水开始");
            processService.timingBaoFuDirectPaymentStatementsTasklet();
            MarvelsLogUtil.getInstance().info(">>>>>>定时查询时间段内未匹配的转账流水结束");
        }catch (Throwable e) {
            MarvelsLogUtil.getInstance().error(">>>>>>定时查询时间段内未匹配的转账流水异常:",e);
//			throw new Exception("定时生产合同异常",e);
        }
        return RepeatStatus.FINISHED;
    }
}
